home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / 3dvect37.zip / EQU.INC < prev    next >
Text File  |  1994-06-22  |  16KB  |  456 lines

  1. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  2. ;
  3. ; Filename     : equ.inc
  4. ; Included from: 3D1.ASM, 3D2.ASM, 3D3.ASM
  5. ; Description  : Conditional assembley variables and general constants.
  6. ;              : No data is here, just parameters
  7. ;
  8. ; Written by: John McCarthy
  9. ;             1316 Redwood Lane
  10. ;             Pickering, Ontario.
  11. ;             Canada, Earth, Milky Way (for those out-of-towners)
  12. ;             L1X 1C5
  13. ;
  14. ; Internet/Usenet:  BRIAN.MCCARTHY@CANREM.COM
  15. ;         Fidonet:  Brian McCarthy 1:229/15
  16. ;   RIME/Relaynet: ->CRS
  17. ;
  18. ; Home phone, (905) 831-1944, don't call at 2 am eh!
  19. ;
  20. ; John Mccarthy would really love to work for a company programming Robots
  21. ; or doing some high intensive CPU work.  Hint. Hint.
  22. ;
  23. ; Send me your protected mode source code!
  24. ; Send me your Objects!
  25. ; But most of all, Send me a postcard!!!!
  26. ;
  27. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  28.  
  29. yes     equ 0
  30. no      equ -1
  31.  
  32. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  33. ; constants for optimal conditional assembley
  34. ; don't pay for features you'll never use! (timewise)
  35. ; these are the most signifigant factors in determining speed!!
  36. ; note:bitmaps also slow things down...
  37. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  38.  
  39. usez       equ no            ; z camera rotations ommited if no, saves 12 imuls
  40.                              ; this speeds up computation in "compound" matrix
  41. useborders equ yes           ; lxupdate and xupdate will be skipped if no.
  42.                              ; set to no if you have no intention of ever
  43.                              ; using the clear_fill routine. this really
  44.                              ; is used if you will have a landscape in the
  45.                              ; background and you want the fake_line routine
  46.                              ; to be faster, and to skip slow "clear_fill".
  47. usefastborders equ no        ; conditional to use memory hungry but fast clear
  48. use_half_stars equ no        ; use full stars or half stars. (full=set to no)
  49. perfect_stars  equ no        ; fast star calculation if no, perfect if yes.
  50.  
  51. ; thats the end of conditional assembley constants!
  52.  
  53. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  54. ; colour crap
  55. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  56.  
  57. bulletcolour equ 4           ; what colour is single point object, from palette
  58. shading_colours equ 16       ; number of colours for lambert shading, 16 or 32. see math.inc
  59.  
  60. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  61. ; variables for object and polygon routine
  62. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  63.  
  64. tolerance  equ 300           ; max center of gravity offset for objects/ratio (onscreen pixel distance)
  65. ztruncate  equ 60            ; if z< ztruncate, z=ztruncate:for make3d (16 bit distance)
  66. minz       equ 50            ; minimum z before object can be seen:for make1obj (16 bit distance)
  67. maxz       equ 500000        ; maximum distance in any axis object can be seen (24 bit distance)
  68. followtol  equ 15            ; tolerance if already looking at object,newfollow (angle)
  69. collision  equ 10            ; tolerence for merging two objects into 1 (for 3d3, 16 bit distance)
  70.  
  71. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  72. ; polygon constants
  73. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  74.  
  75. maxpoints   equ 900          ; max points (*total* on screen if 3d2)
  76. maxsurfaces equ 900          ; max object surfaces (*total* on screen if 3d2)
  77. mult        equ 4            ; shl ax,mult for number of sides
  78. maxpolys    equ 16 ;2^mult   ; max sides to a polygon,must = 2^mult,keep small!!
  79. maxobjects  equ 40;50,100,?? ; number of objects possible on screen at once
  80.  
  81. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  82. ; data definition allocation
  83. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  84.  
  85. numberofshapes  equ 32       ; number of 3d shapes to allocate space for
  86. numberofbitmaps equ 32       ; number of 3d bitmaps to allocate space for
  87. numberofpals    equ 10       ; number of selectable palette cross refnce tables
  88. numberofstones  equ 32       ; number of stones textures available
  89.  
  90. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  91. ; Options for objects - note, some of these commands must be allowed to overlap
  92. ; point,line,texture,himap,lomap must not be at the same bit  location  as  the
  93. ; texture options.  eg line cannot equal 128 because  this  would  get  smushed
  94. ; with shade.
  95. ;
  96. ; To re-cap:
  97. ;
  98. ; There cannot be conflicts between (texture options) and (surface types)
  99. ;
  100. ; There cannot be conflicts between (surface types) and (surface commands or
  101. ; internal commands or visibility commands)
  102. ;
  103. ; Conflicts between (texture options) and (surface commands or internal
  104. ; commands or visibility commands) are not important
  105. ;
  106. ; The texture options wavey,mesh and  glenz MUST be accessable from the  high
  107. ; byte of a register.  Considering these  options cannot  be  combined,  they
  108. ; can be added to perform other texture options.  See poly.inc for the  table
  109. ; Anything with the glenz texture in it, will be polyfilled up/down. Textures
  110. ; without the glenz option will be filled left/right.
  111. ;
  112. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  113.  
  114. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  115. ; texture options
  116. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  117. wavey    equ 512             ; texture options see objects.inc for explanations
  118. shade    equ 2
  119. inverse  equ 4
  120. glow     equ shade+inverse
  121. last     equ 8
  122. texture  equ 16
  123. mesh     equ 256
  124. auto_s   equ 128             ; pre-calculate shading intensity when angles=0,0,0
  125. glenz    equ 1024
  126. stone    equ glenz+mesh      ; copy bitmap to screen (non-rotatable,non-scalable)
  127.  
  128. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  129. ; surface types
  130. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  131. point    equ 32              ; surface types
  132. line     equ 64              ; these options must not conflict with the stuff above or below
  133.  
  134. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  135. ; surface commands
  136. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  137. iterate  equ 256
  138. matrix   equ 512
  139.  
  140. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  141. ; internal commands, not for use by you
  142. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  143. normal   equ 1024
  144. centroid equ 1
  145.  
  146. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  147. ; visibility determination methods
  148. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  149. both     equ 1
  150. double   equ 2
  151. onscr    equ 4
  152. check    equ 8
  153.  
  154. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  155. ; special non-surface oriented commands
  156. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  157. special           equ 128       ; any command that the high bit set (128) will not have any connection data
  158. himap             equ special+0
  159. lomap             equ special+1
  160. push_matrix       equ special+2 ; push matrix
  161. pop_matrix        equ special+3 ; pop matrix
  162. push_location     equ special+4 ; push location
  163. pop_location      equ special+5 ; pop location
  164. sub_object        equ special+6 ; sub_object = matrix+check+iteration+both,?,?,?,?,0,0
  165. static_sub_object equ special+7 ; non-rotatable sub_object = check+iteration+both,?,?,?,?,0,0
  166. gosub             equ special+8 ; just like the basic command - sends the connection routine to another location in memory (16bit relative), pushes old offset
  167. return            equ special+9 ; just like the basic command - return offset from stack and go to it (32bit absolute)
  168. goto_offset       equ special+10 ; just like the basic command - go to offset specified (16bit relative)
  169.  
  170. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  171. ; commands for onoff[esi]
  172. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  173. mainobject_on equ 1
  174. sub_object_on equ 2
  175.  
  176. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  177. ; commands for userotate[esi]
  178. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  179. full_rotations equ 0         ; object has full rotation capability
  180. no_rotation    equ 1         ; object has no rotation
  181. s_point        equ point     ; static point/bullet
  182. s_himap        equ himap     ; object is a static bitmap - like explosions...
  183. s_lomap        equ lomap
  184.  
  185. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  186. ; animation settings
  187. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  188.  
  189. number_of_spaces equ 20      ; number of spaces free for animation headers
  190.  
  191. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  192. ; where is the camera in the list
  193. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  194.  
  195. cameraobject equ 0           ; camera is zero'th object in list
  196.  
  197. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  198. ; ===== general xmode constants =====
  199. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  200.  
  201. false   equ 0
  202. true    equ -1
  203. nil     equ 0
  204.  
  205. b       equ byte ptr
  206. w       equ word ptr
  207. d       equ dword ptr
  208. o       equ offset
  209. f       equ far ptr
  210. s       equ short
  211. ?x4     equ <?,?,?,?>
  212. ?x3     equ <?,?,?>
  213.  
  214. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  215. ; ===== vga register values =====
  216. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  217.  
  218. vga_segment     equ d 0a0000h ; vga memory segment (ok, this is protected mode, right?, so this is the actual address - hahahaha to all you real mode losers...)
  219.  
  220. attrib_ctrl     equ 03c0h   ; vga attribute controller
  221. gc_index        equ 03ceh   ; vga graphics controller
  222. sc_index        equ 03c4h   ; vga sequencer controller
  223. sc_data         equ 03c5h   ; vga sequencer data port
  224. crtc_index      equ 03d4h   ; vga crt controller
  225. crtc_data       equ 03d5h   ; vga crt controller data
  226. misc_output     equ 03c2h   ; vga misc register
  227. input_1         equ 03dah   ; input status #1 register
  228.  
  229. dac_write_addr  equ 03c8h   ; vga dac write addr register
  230. dac_read_addr   equ 03c7h   ; vga dac read addr register
  231. pel_data_reg    equ 03c9h   ; vga dac/pel data register r/w
  232.  
  233. pixel_pan_reg   equ 033h    ; attrib index: pixel pan reg
  234. map_mask        equ 002h    ; sequ index: write map mask reg
  235. read_map        equ 004h    ; gc index: read map register
  236. start_disp_hi   equ 00ch    ; crtc index: display start hi
  237. start_disp_lo   equ 00dh    ; crtc index: display start lo
  238.  
  239. map_mask_plane1 equ 00102h  ; map register + plane 1
  240. map_mask_plane2 equ 01102h  ; map register + plane 2
  241. all_planes_on   equ 00f02h  ; map register + all bit planes
  242.  
  243. chain4_off      equ 00604h  ; chain 4 mode off
  244. async_reset     equ 00100h  ; (a)synchronous reset
  245. sequ_restart    equ 00300h  ; sequencer restart
  246.  
  247. latches_on      equ 00008h  ; bit mask + data from latches
  248. latches_off     equ 0ff08h  ; bit mask + data from cpu
  249.  
  250. vert_retrace    equ 08h     ; input_1: vertical retrace bit
  251. plane_bits      equ 03h     ; bits 0-1 of xpos = plane #
  252. all_planes      equ 0fh     ; all bit planes selected
  253. char_bits       equ 0fh     ; bits 0-3 of character data
  254.  
  255. get_char_ptr    equ 01130h  ; vga bios func: get char set
  256. rom_8x8_lo      equ 03h     ; rom 8x8 char set lo pointer
  257. rom_8x8_hi      equ 04h     ; rom 8x8 char set hi pointer
  258.  
  259. num_modes       equ 8       ; # of mode x variations
  260.  
  261. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  262. ; mode x definitions
  263. ;
  264. ;  0 =  320 x 200
  265. ;  1 =  320 x 400
  266. ;  2 =  360 x 200
  267. ;  3 =  360 x 400
  268. ;  4 =  320 x 240
  269. ;  5 =  320 x 480
  270. ;  6 =  360 x 240
  271. ;  7 =  360 x 480
  272. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  273.  
  274. videomode  equ -1
  275.  
  276.            if videomode eq 0
  277.  
  278. xmode      equ videomode
  279. xmax       equ 160       ; right colomn just beyond screen for clipping
  280. xmin       equ -160      ; left coloumn on screen, x's must be "and 0fff8h"
  281. ymax       equ 100       ; lower row just beyond screen
  282. ymin       equ -100      ; upper row on screen
  283. xactual    equ 320       ; guess...
  284. yactual    equ 200
  285.  
  286. xcenter    equ 160       ; screen center x,y for actual screen point (0,0)
  287. ycenter    equ 100       ; make sure clipping still stays inside screen
  288.  
  289. ratiox     equ 320       ; aspect ratio for 3d conversion (zoom)
  290. ratioy     equ 240       ; make x and y different to fine tune (draw circle)
  291. pages      equ 4         ; # of video pages mode will support, (don't modify)
  292.  
  293.            elseif videomode eq 1
  294.  
  295. xmode      equ videomode
  296. xmax       equ 160
  297. xmin       equ -160
  298. ymax       equ 200
  299. ymin       equ -200
  300. xactual    equ 320
  301. yactual    equ 400
  302.  
  303. xcenter    equ 160
  304. ycenter    equ 200
  305.  
  306. ratiox     equ 320
  307. ratioy     equ 464
  308. pages      equ 2
  309.  
  310.            elseif videomode eq 2
  311.  
  312. xmode      equ videomode
  313. xmax       equ 180
  314. xmin       equ -180
  315. ymax       equ 100
  316. ymin       equ -100
  317. xactual    equ 360
  318. yactual    equ 200
  319.  
  320. xcenter    equ 180
  321. ycenter    equ 100
  322.  
  323. ratiox     equ 320
  324. ratioy     equ 240
  325. pages      equ 3
  326.  
  327.            elseif videomode eq 3
  328.  
  329. xmode      equ videomode
  330. xmax       equ 180
  331. xmin       equ -180
  332. ymax       equ 200
  333. ymin       equ -200
  334. xactual    equ 360
  335. yactual    equ 400
  336.  
  337. xcenter    equ 180
  338. ycenter    equ 200
  339.  
  340. ratiox     equ 300
  341. ratioy     equ 416
  342. pages      equ 1
  343.  
  344.            elseif videomode eq 4
  345.  
  346. xmode      equ videomode
  347. xmax       equ 160
  348. xmin       equ -160
  349. ymax       equ 120
  350. ymin       equ -120
  351. xactual    equ 320
  352. yactual    equ 240
  353.  
  354. xcenter    equ 160
  355. ycenter    equ 120
  356.  
  357. ratiox     equ 300
  358. ratioy     equ 280
  359. pages      equ 3
  360.  
  361.            elseif videomode eq 5
  362.  
  363. xmode      equ videomode
  364. xmax       equ 160
  365. xmin       equ -160
  366. ymax       equ 240
  367. ymin       equ -240
  368. xactual    equ 320
  369. yactual    equ 480
  370.  
  371. xcenter    equ 160
  372. ycenter    equ 240
  373.  
  374. ratiox     equ 260
  375. ratioy     equ 460
  376. pages      equ 1
  377.  
  378.            elseif videomode eq 6
  379.  
  380. xmode      equ videomode
  381. xmax       equ 180
  382. xmin       equ -180
  383. ymax       equ 120
  384. ymin       equ -120
  385. xactual    equ 360
  386. yactual    equ 240
  387.  
  388. xcenter    equ 180
  389. ycenter    equ 120
  390.  
  391. ratiox     equ 320
  392. ratioy     equ 260
  393. pages      equ 3
  394.  
  395.            elseif videomode eq 7
  396.  
  397. xmode      equ videomode
  398. xmax       equ 180
  399. xmin       equ -180
  400. ymax       equ 240
  401. ymin       equ -240
  402. xactual    equ 360
  403. yactual    equ 480
  404.  
  405. xcenter    equ 180
  406. ycenter    equ 240
  407.  
  408. ratiox     equ 280
  409. ratioy     equ 448
  410. pages      equ 1
  411.  
  412. ; if videomode = -1, custom configuration
  413.  
  414.            elseif videomode eq -1
  415.  
  416. xmode      equ 1
  417. xmax       equ 9*16
  418. xmin       equ -9*16
  419. ymax       equ 110
  420. ymin       equ -130
  421. ;xmax       equ 9*16
  422. ;xmin       equ -9*16
  423. ;ymax       equ 110
  424. ;ymin       equ -130
  425. xactual    equ 320
  426. yactual    equ 400
  427.  
  428. xcenter    equ 160
  429. ycenter    equ 200
  430.  
  431. ratiox     equ 320
  432. ratioy     equ 464
  433. pages      equ 2
  434.  
  435. ; if videomode = -2, custom configuration
  436.  
  437.            elseif videomode eq -2
  438.  
  439. xmode      equ 0
  440. xmax       equ 9*16
  441. xmin       equ -9*16
  442. ymax       equ 60
  443. ymin       equ -60
  444. xactual    equ 320
  445. yactual    equ 200
  446.  
  447. xcenter    equ 160
  448. ycenter    equ 100
  449.  
  450. ratiox     equ 320
  451. ratioy     equ 240
  452. pages      equ 2
  453.  
  454.            endif
  455.  
  456.